$classes[] = Sanitizer::escapeClass( self::CSS_CLASS_PREFIX . 'ns-' .
$rc->mAttribs['rc_namespace'] );
+ $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
+ $classes[] = Sanitizer::escapeClass(
+ self::CSS_CLASS_PREFIX .
+ 'ns-' .
+ ( $nsInfo->isTalk( $rc->mAttribs['rc_namespace'] ) ? 'talk' : 'subject' )
+ );
+
if ( $this->filterGroups !== null ) {
foreach ( $this->filterGroups as $filterGroup ) {
foreach ( $filterGroup->getFilters() as $filter ) {
public function insertLog( &$s, $title, $logtype ) {
$page = new LogPage( $logtype );
$logname = $page->getName()->setContext( $this->getContext() )->text();
- $s .= $this->msg( 'parentheses' )->rawParams(
- $this->linkRenderer->makeKnownLink( $title, $logname )
- )->escaped();
+ $s .= Html::rawElement( 'span', [
+ 'class' => 'mw-changeslist-links'
+ ], $this->linkRenderer->makeKnownLink( $title, $logname ) );
}
/**
$formatter->setShowUserToolLinks( true );
$mark = $this->getLanguage()->getDirMark();
- return $formatter->getActionText() . " $mark" . $formatter->getComment();
+ return Html::openElement( 'span', [ 'class' => 'mw-changeslist-log-entry' ] )
+ . $formatter->getActionText() . " $mark" . $formatter->getComment()
+ . Html::closeElement( 'span' );
}
/**
* field of this revision, if it's marked as deleted.
* @param RCCacheEntry|RecentChange $rc
* @param int $field
- * @param User|null $user User object to check, or null to use $wgUser
+ * @param User|null $user User object to check against. If null, the global RequestContext's
+ * User is assumed instead.
* @return bool
*/
public static function userCan( $rc, $field, User $user = null ) {
+ if ( $user === null ) {
+ $user = RequestContext::getMain()->getUser();
+ }
+
if ( $rc->mAttribs['rc_type'] == RC_LOG ) {
return LogEventsList::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
- } else {
- return Revision::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
}
+
+ return RevisionRecord::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
}
/**
) {
$title = $rc->getTitle();
/** Check for rollback permissions, disallow special pages, and only
- * show a link on the top-most revision */
+ * show a link on the top-most revision
+ */
if ( $title->quickUserCan( 'rollback', $this->getUser() ) ) {
$rev = new Revision( [
'title' => $title,